#!/bin/bash
#--enable-x86asm --enable-w32threads

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

echo "Make Win10 x86"
echo "config ..............."

# --toolchain=msvc --arch=x86_32 --target-os=win32 --enable-x86asm --enable-w32threads \
# --toolchain=msvc --target-os=win32 --arch=x86 --enable-x86asm --enable-w32threads --enable-optimizations \



./configure \
--toolchain=msvc --arch=x86_32 --target-os=win32 --enable-x86asm --enable-w32threads \
--enable-cross-compile \
--enable-small \
--enable-version3 \
--enable-gpl \
--enable-nonfree \
--enable-optimizations \
--disable-everything \
--disable-indevs \
--disable-outdevs \
--disable-stripping \
--disable-runtime-cpudetect \
--disable-doc \
--disable-debug \
--disable-programs \
--disable-ffmpeg \
--disable-ffprobe \
--disable-ffplay \
--enable-shared --disable-static \
--disable-postproc \
--enable-swscale --enable-swresample --enable-runtime-cpudetect \
--disable-encoders --enable-encoder=mjpeg,mpeg4 \
--disable-decoders --enable-decoder=mpeg4,mpegvideo,aac,gif,h264 \
--enable-muxers \
--disable-demuxers --enable-demuxer=mp4,h264,aac,avi,flv,rtsp,hls,*mpeg*,pcm_* \
--disable-parsers --enable-parser=h264,aac,*jpeg*,mpeg* \
--enable-filter=scale,fps,copy,palettegen,vflip,paletteuse,crop \
--enable-protocols --enable-protocol=file \
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" \
--extra-ldflags="-APPCONTAINER WindowsApp.lib" \
--prefix=./win32 \
|| exit 1



echo "make clean"

make clean

echo "make install ...."
make -j4 || exit 1
make install || exit 1

echo "Sucess!!!!"
